<!doctype html>
<html>
<head>
  <title>GitHub Authentication Example</title>
  <!--- This example uses jQuery: -->
  <script src="https://code.jquery.com/jquery-1.11.2.js"></script>

  <!-- Make sure to include Nelify's authentiation library -->
  <!-- Also available via npm as netlify-auth-providers -->
  <script src="https://unpkg.com/netlify-auth-providers"></script>

  <script>
    $(function() {
      $("#login").on("click", function(e) {
        e.preventDefault();
        var authenticator = new netlify.default ({site_id: "1105a562-872f-42d2-a4e1-4ad6789392e5"});
        authenticator.authenticate({provider:"github", scope: "repo"}, function(err, data) {
          if (err) {
            return $("#output").text("Error Authenticating with GitHub: " + err);
          }
          $("#output").text("Authenticated with GitHub. Access Token: " + data.token);
        });
      });
    });
  </script>
</head>
<body>
  <h1>GitHub Auth Demo:</h1>
  <p><a href="#" id="login">Authenticate</a></p>
  <p id="output"></p>
</body>
</html>